<?php

class LanguageModel extends Models
{
    protected $tableName='language';

    public function getTableName(){
        return $this->tableName;
    }

    public function getId()
    {
        if(!$langCode=$this->config->get('config_language')) $langCode='en';

        if($lang=$this->findByAttributes(array('code'=>$langCode))){
            if(isset($lang['language_id'])) return $lang['language_id'];
            else return 1;
        }else
            return 1;
    }
}